﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FightAttack : MonoBehaviour {

    private GlobalData Data;
    private Personage Person;

	// Use this for initialization
	void Start () {
        Data = GlobalData.Instance;
        Person = Data.OurFightTeam[0];
    }
	
	// Update is called once per frame
	void Update () {
		
	}

    public void ChooseAttackTarget() {

    }

    public void Attack() {
        Person.AttWuxue = Person.AttWuxues[0];
        Person.ChooseAttackTarget();
        FightManager fightManager = FightManager.Instance;
        fightManager.ChooseWuxueAndAttackTarget();
        fightManager.FightAction();
    }

    public void Rest() {
        FightPersonage fightPersonage = GameObject.Find("Player").GetComponent<FightPersonage>();
        System.Random r = new System.Random();
        int number = r.Next(1, 3);
        FightPersonage enemy = GameObject.Find("Enemy" + number).GetComponent<FightPersonage>();
        fightPersonage.Attack(enemy);
    }
}
